library("nbastatR")
library(plotly)
players2020<-bref_players_stats(seasons = 2020, tables = c("per_game", "per_poss"))
fig <- plot_ly()
fig <- fig %>%
add_trace(
type = "scatter",
x = players2020$pctFT,
y = players2020$pctFG3,
color = players2020$groupPosition,
size = players2020$fg3aPerGame,
text = players2020$namePlayer,
hovertemplate=paste('Player: %{text}',
'<br>FT Pct: %{x}<br>',
'3PT Pct: %{y}')
)
fig